import java.awt.Color;
import java.awt.Graphics;
/*import java.awt.Cursor;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
*/
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class DiagramPanel extends JPanel {
	private ServiceIcon serviceIcon;
/*	private DropTarget dropTarget;

	public DiagramPanel() {
		dropTarget = new DropTarget(this, new DropTargetListener() {
			
			@Override
			public void dragEnter(DropTargetDragEvent arg0) {
				System.out.println("Panel - drag enter");
			}

			@Override
			public void dragExit(DropTargetEvent arg0) {
				System.out.println("Panel - darg exit");
			}

			@Override
			public void dragOver(DropTargetDragEvent arg0) {
				System.out.println("Panel - drag over");
			}

			@Override
			public void drop(DropTargetDropEvent arg0) {
				System.out.println("Panel - drag drop");
			}

			@Override
			public void dropActionChanged(DropTargetDragEvent arg0) {
				System.out.println("Panel - drag action changed");
			}
		});
	}

*/	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		if (serviceIcon == null)
			return;
		g.setColor(Color.BLACK);
		g.drawRect(serviceIcon.getX(), serviceIcon.getY(), 20, 10);
	}

	public void drawServiceIcon(Service service, int x, int y) {
		if (serviceIcon == null) {
			serviceIcon = new ServiceIcon(service);
		}
		serviceIcon.setPoint(x, y);
		repaint();
	}

	public void clearServiceIcon(Service service) {
		serviceIcon = null;
		repaint();
	}
}
